package com.web.ShoppingDemo.daoImpl;

import org.springframework.stereotype.Repository;

import com.web.ShoppingDemo.dao.UserDao;
import com.web.ShoppingDemo.model.User;

@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao{

	@Override
	public User getLogin(User user) {
		String hql = "FROM User u WHERE u.login = :login AND u.pass = :pass";
		return (User)getSession().createQuery(hql)
					.setString("login", user.getLogin())
					.setString("pass", user.getPass())
					.uniqueResult();
		
	}

}
